#ifndef IF_THEN_ELSE_SCHEDULER_H
#define IF_THEN_ELSE_SCHEDULER_H

#include "abstract_scheduler.h"
#include "global.h"

namespace scheduler
{
/**
 * @brief: 条件判断，类似if-else
 *
 * 执行顺序：
 * if condition task/scheduler:
 *      then task/scheduler
 * else:
 *      else task/scheduler
 * @author: sherlock_lht
 */
class IfThenElseScheduler: public AbstractScheduler
{
public:
    explicit IfThenElseScheduler(const std::string &name);
    ~IfThenElseScheduler() override;

    /**
     * @brief:  设置条件判断
     * @author: sherlock_lht
     */
    bool setConditionTask(const task::AbstractTaskConstPtr &task);
    bool setConditionScheduler(const AbstractSchedulerConstPtr &scheduler);

    /**
     * @brief:  设置then task/scheduler
     * @author: sherlock_lht
     */
    bool setThenTask(const task::AbstractTaskConstPtr &task);
    bool setThenScheduler(const AbstractSchedulerConstPtr &scheduler);

    /**
     * @brief:  设置else task/scheduler
     * @author: sherlock_lht
     */
    bool setElseTask(const task::AbstractTaskConstPtr &task);
    bool setElseScheduler(const AbstractSchedulerConstPtr &scheduler);

    [[deprecated("if else scheduler cannot append task")]] bool appendTask(const task::AbstractTaskConstPtr &task) override;

    [[deprecated("if else scheduler cannot append scheduler")]] bool appendScheduler(const AbstractSchedulerConstPtr &scheduler) override;

    [[deprecated("if else scheduler cannot set task")]] bool setTask(const task::AbstractTaskConstPtr &task) override;

    [[deprecated("if else scheduler cannot set scheduler")]] bool setScheduler(const AbstractSchedulerConstPtr &scheduler) override;
};

}

#endif //IF_THEN_ELSE_SCHEDULER_H
